import {defineConfig} from 'vite'
import vueJsx from '@vitejs/plugin-vue-jsx';
import vue from '@vitejs/plugin-vue'
import path from 'path'

export default defineConfig({
    plugins: [vue(), vueJsx()],
    publicDir: './public',
    css: {
        preprocessorOptions: {
            less: {
                modifyVars: {
                    'primary-color': '#2C82E0',
                    'success-color': '#40e583',
                    'warning-color': '#FFAC0A',
                    'error-color': '#DE1041',
                    'text-color': '#1B1A1F',
                    'btn-font-weight': 600
                },
                javascriptEnabled: true
            }
        },
        postcss: {
            plugins: []
        }
    },
    base: './',
    server: {
        host: '0.0.0.0',
        port: 3000,
        open: true,
        // https:true,
        proxy: {
            // '/api': {
            //   target:"http://192.168.0.19:8080",
            //   // target: 'http://139.196.12.3:8094/api',
            //   changeOrigin: true,
            //   rewrite: (path) => path.replace(/^\/api/, '')
            // },
            // '/data': {
            //   target:'http://139.196.12.3:8094/data',
            //   changeOrigin: true,
            //   rewrite: (path) => path.replace(/^\/data/, '')
            // }
        }
    },
    resolve: {
        alias: {
            "@": path.resolve(__dirname, "src")
        }
    }
})
